# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-pypdf
_pkgname=${pkgname#python-}
pkgver=3.17.4
pkgrel=3
pkgdesc='Python library for manipulating pages of PDF files (v3+)'
arch=('any')
url="https://github.com/py-pdf/py-pdf"
license=('BSD')
depends=('python' 'python-flit-core')
makedepends=('python-build' 'python-installer' 'python-pip' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('6fc6505ce449e99609c55525c555c4008577db45b55910aa5803d70bd517824ac7077780c3dde64bab2d623a7c1a16301027183b0f689b1337180a61550504e8')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

